<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<% 
String e_i=request.getParameter("employee_id"); 
String e_phone=request.getParameter("phone");
String e_name=request.getParameter("employee_name");
String e_qualification=request.getParameter("qualification");
String e_gender=request.getParameter("gender");
String e_notice=request.getParameter("notice");
int e_id=Integer.parseInt(e_i);
%>
<%
String query="insert into employee values("+e_id+","+"'"+e_name+"'"+","+"'"+e_phone+"'"+","+"'"+e_qualification+"'"+","+"'"+e_gender+"'"+","+"'"+e_notice+"'"+")";
Connection db_conn = null;
Statement statement = null;
PreparedStatement pstmt;
ResultSet rs;
try{
Class.forName("com.mysql.jdbc.Driver");
String url= "jdbc:mysql://localhost:3306/db";
db_conn = DriverManager.getConnection( url,"root", "root" );
statement = db_conn.createStatement();
statement.executeUpdate(query);

db_conn.close();
} catch(SQLException e){
e.printStackTrace();
out.println("sql not found");
out.println(e);
} catch(ClassNotFoundException e){
e.printStackTrace();
out.println(e);
}
%>            



